<template lang='pug'>
  section
    van-nav-bar(
      title="物流信息"
      left-arrow
      @click-left="$router.back()"
      )
    empty(title="暂未查到该物流信息..." v-show="!logistics || !logistics.Traces")
    van-steps(direction="vertical" :active="0" active-color="#f44" v-if="logistics")
      van-step(v-for="logistic in logistics.Traces" :key="logistic.id")
       h3 {{logistic.AcceptStation}}
       p {{logistic.AcceptTime}}
</template>

<script type='text/ecmascript-6'>
  import empty from '~/components/empty'

  export default {
    components: {
      empty
    },
    data() {
      return {

      }
    },
    async asyncData({ $post, route }) {
      const id = route.params.id
      const resp = await $post('/api/platform/orderDetail/findTracesByOrderDetailId', {orderDetailId: id})
      let logistics = resp.code === 200 ? (resp.msg || 'null') : 'null' 
      logistics = JSON.parse(logistics)
      if (logistics && logistics.Traces) logistics.Traces.reverse()
      return { logistics }
    },
    methods: {
      
    }
  }
</script>

<style lang='stylus' rel='stylesheet/stylus' scoped>

@import '~assets/stylus/variable.styl'
 
</style>
